<html>
<head>
<script type="text/javascript">
function confirm_me(){
	//alert("woot");
	return confirm("Are you sure you want to delete these questions?");

}
</script>
</head>
<body>

<?php
	echo anchor('user/add_question/'.$survey_id.'/'.$id,'Add a question'); echo "   |   ";
	echo anchor('user/delete_questions/'.$survey_id.'/'.$id,'Delete a Question'); echo "   |   ";
	echo anchor('user/update_questions/'.$survey_id.'/'.$id,'Update a Question');
	echo "<br>";?>
<form method="POST" action='http://localhost/pollwatcher/index.php/user/actual_deletion/<?php echo $survey_id; ?>/' onsubmit="return confirm_me()">
	<?php
		//echo form_open('user/actual_deletion/'.$survey_id.'/');
		$index = 0;
		foreach($questions->result() as $toDelete){
			$q_num = $toDelete->question_number;
			$body = $toDelete->body;
			$id = "chkDel";
			echo "<input type='checkbox' id=\"$id\" value ='$q_num' name='choice[]' />";
			echo "<label for=\"$id\">";
			echo " $body";
			echo "</label>";
			echo "<br>";
		}
		if ($questions->num_rows == 0){
		}
		else{
			echo "<input type='submit' name='delete' value='Delete'>";
		}
	?>

	
</body>
</html>
